-- gain_sp
-- created by panyl
-- 战斗统计规则：获得探索点

local handle = function(para)
    -- 如果不是在地牢内就忽略
    if not DungeonM.isInDungeon() then
        return;
    end
    
    local attrib = para.attrib;
    local count = para.count;
    if attrib ~= "search_point" then
        return;
    end

    -- 增加进度
    local id = CombatStatM.queryByRule("gain_sp", "id");
    CombatStatM.addProgress(id, count);
end

-- 获得探索点事件
EventMgr.register("gain_sp", event.BONUS_ATTRIB, handle);

return {
    progress = function()
        local id = CombatStatM.queryByRule("gain_sp", "id");
        return CombatStatM.getProgress(id);
    end,
};